package com.ruoyi.business.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.CzProcessMapper;
import com.ruoyi.business.domain.CzProcess;
import com.ruoyi.business.service.ICzProcessService;

/**
 * 流程Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-01-01
 */
@Service
public class CzProcessServiceImpl implements ICzProcessService 
{
    @Autowired
    private CzProcessMapper czProcessMapper;

    /**
     * 查询流程
     * 
     * @param id 流程主键
     * @return 流程
     */
    @Override
    public CzProcess selectCzProcessById(Long id)
    {
        return czProcessMapper.selectCzProcessById(id);
    }

    /**
     * 查询流程列表
     * 
     * @param czProcess 流程
     * @return 流程
     */
    @Override
    public List<CzProcess> selectCzProcessList(CzProcess czProcess)
    {
        return czProcessMapper.selectCzProcessList(czProcess);
    }

    /**
     * 新增流程
     * 
     * @param czProcess 流程
     * @return 结果
     */
    @Override
    public int insertCzProcess(CzProcess czProcess)
    {
        czProcess.setCreateTime(DateUtils.getNowDate());
        return czProcessMapper.insertCzProcess(czProcess);
    }

    /**
     * 修改流程
     * 
     * @param czProcess 流程
     * @return 结果
     */
    @Override
    public int updateCzProcess(CzProcess czProcess)
    {
        czProcess.setUpdateTime(DateUtils.getNowDate());
        return czProcessMapper.updateCzProcess(czProcess);
    }

    /**
     * 批量删除流程
     * 
     * @param ids 需要删除的流程主键
     * @return 结果
     */
    @Override
    public int deleteCzProcessByIds(Long[] ids)
    {
        return czProcessMapper.deleteCzProcessByIds(ids);
    }

    /**
     * 删除流程信息
     * 
     * @param id 流程主键
     * @return 结果
     */
    @Override
    public int deleteCzProcessById(Long id)
    {
        return czProcessMapper.deleteCzProcessById(id);
    }
}
